#include<stdio.h>
int main(){
    int arr[] = {1,2,3,4,5,1,2,3,4,6};
	int sz = sizeof(arr);
	int* left = arr;
	int* right = arr + sz - 1;
	int* s = right;
	while(left < s){
	   while(*left != *s && left < s){
		s--;
	   }
		if(left == s){
		printf("%d ",*s);	
		}
		left++;
		s = right;
	}
	return 0;
}
